package com.alks.function.controller.finance.costcheck;

import com.alks.common.aop.ApiRestController;
import com.alks.common.aop.WebLogger;
import com.alks.entity.data.entity.PcLotMtlPrice;
import com.alks.entity.data.response.ResponseInfo;
import com.alks.function.data.request.mtl.GenericMaterialDocReq;
import com.alks.function.service.impl.PcLotMtlPriceServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@ApiRestController("/lot")
@Api(tags = "指令材料单价建档")
public class LotMtlUsgPriceController {
    @Autowired
    PcLotMtlPriceServiceImpl priceService;
    //指令材料单价建档
    @PostMapping("/getLotMtlUsgPrice")
    @WebLogger
    @ApiOperation(value = "指令材料单价明细")
    public ResponseInfo getLotMtlUsgPrice(@RequestBody GenericMaterialDocReq req) {
        return priceService.getLotMtlUsgPrice(req);
    }

    @PostMapping("/optionGenericLotMtl")
    @WebLogger
    @ApiOperation(value = "打勾记录复制、删除")
    public ResponseInfo optionGenericLotMtl(@RequestBody List<PcLotMtlPrice> list, @RequestParam @ApiParam(value = "1：打勾记录添加 2：打勾记录删除") String choose) {
        return priceService.optionGenericLotMtl(list, choose);
    }

//    public ResponseInfo update

    @PostMapping("/getLotMtlUsgPriceChe")
    @WebLogger
    @ApiOperation(value = "指令材料单价检核明细")
    public ResponseInfo getLotMtlUsgPriceChe(@RequestBody GenericMaterialDocReq req) {
        return priceService.getLotMtlUsgPriceChe(req);
    }
    @PostMapping("/updateLotMtlCheck")
    @WebLogger
    @ApiOperation(value = "打勾检核、取消检核")
    public ResponseInfo updateLotMtlCheck(@RequestBody List<PcLotMtlPrice> list,@RequestParam @ApiParam(value = "1：检核 2：取消检核") String choose){
        return priceService.updateLotMtlCheck(list,choose);
    }

}
